<!--
 * @Date: 2023-01-05 18:11:09
 * @LastEditors: 许成志 18296777223@163.com
 * @LastEditTime: 2023-01-11 17:26:43
-->
<!--  -->
<template>
  <div>
    <template v-for="item in menuList">
      <el-submenu :index="item.id" v-if="item.children" :key="item.index">
        <template slot="title">
          <span slot="title">{{item.name}}</span>
        </template>
        <MenuTree :menuList="item.children"></MenuTree>
      </el-submenu>
      <el-menu-item v-if="!item.children" :index="item.url" :key="item.index">{{item.name}}</el-menu-item>
    </template>
  </div>
</template>

<script>
export default {
  name:'MenuTree',
  data () {
    return {
    };
  },
  props:{
    menuList: {
      type: Array,
      default: []
    }
  },
  created(){
    console.log('this.menuList=', this.menuList)
  },
  components: {},

  computed: {},

  methods: {}
}

</script>
<style lang='less' scoped>
</style>